<?php
//demo1工厂模式
/*interface IUser
{
    function getName();
}

class User Implements IUser
{
   public function getName()
   {
       return 'Jack';
   }
}

class UserFactory
{
    public static function Create($id)
    {
        return new User($id);
    }
}
$user = UserFactory::Create(1);
var_dump($user);*/

/*interface IUser
{
    function getName();
}

class User implements IUser
{
    public static function load($id)
    {

    }

    public static function create()
    {
        return new User(null);
    }

    public function __construct($id)
    {

    }

    public function getName()
    {
        return 'jack';
    }
}*/














































































